<?php
/**
 * True Gallery jComments Plugin
 *
 * @version 1.0
 * @author Alexey N. Brin (userxp@joomlaportal.ru)
 * @filename jcomments.php
 * @package True Gallery
 * @copyright (C) 2008-2009 by joomlatune.ru
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 * 
 * If you fork this to create your own project, 
 * please make a reference to True Gallery someplace in your code 
 * and provide a link to http://www.joomlatune.ru
 *
 **/

defined('_VALID_MOS') or defined('_JEXEC') or die('Direct Access to this location is not allowed.');

class JTunePluginJcomments extends JTunePlugin 
{
	var $_name		= 'JComments plugin';
	var $_version	= '1.0';
	var $_enabled	= true;
	var $_access	= '';
	var $group		= 'comments';
	
	function load( $data ) {
		// checking if JComments is installed
		// JPATH_COMPONENTS ?
		$jcfile = JTuneConfig::getCfg('absolute_path').DSX.'components'.DSX.'com_jcomments'.DSX.'jcomments.php';
		if( file_exists( $jcfile) ) {
			require_once( $jcfile );
			if( $showcomments = JComments::showComments( $data->id, TG_CMP, $data->name ) ) {
				echo $showcomments;
			}
		}
	} //load
	
	//TODO:
	function getCommentsCount() {
		//
	}
} //JTunePluginJcomments
